package com.it;

public class Foo {
	
	String s;

	public Foo(String s) {
		this.s = s;
	}

	@Override
	public int hashCode() {
		return s != null ? s.hashCode() : 0;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj || obj != null && obj instanceof Foo foo && this.hashCode() == foo.hashCode()
				&& (this.s == foo.s || this.s.equals(foo.s))) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public String toString() {
		return String.valueOf(s);
	}
}